package de.silvalauinger.objectclassmapper.schema.system.attribute;

import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.collect.HashMultiset;
import static com.google.common.collect.Iterables.addAll;
import com.google.common.collect.Multiset;
import static de.silvalauinger.objectclassmapper.schema.DefaultSchemaManagerFactory.SCHEMA_MANAGER;
import de.silvalauinger.objectclassmapper.schema.system.syntax.ObjectIdentifier;
import java.util.Collection;
import static org.apache.directory.shared.ldap.model.constants.SchemaConstants.*;
import org.apache.directory.shared.ldap.model.schema.AttributeType;

public final class ObjectClass {

    //<editor-fold defaultstate="collapsed" desc="Statics">
    public final static AttributeType ATTRIBUTE_TYPE = checkNotNull(SCHEMA_MANAGER.getAttributeType(OBJECT_CLASS_AT_OID));
    //</editor-fold>
    //<editor-fold defaultstate="collapsed" desc="Attributes">
    private final Multiset<ObjectIdentifier> objectIdentifiers = HashMultiset.create();
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="Constructors">
    public ObjectClass(final Collection<ObjectIdentifier> objectIdentifier) {
        addAll(this.objectIdentifiers, objectIdentifier);
    }
    //</editor-fold>

    @Override
    public String toString() {
        return "ObjectClass{" + "objectIdentifiers=" + objectIdentifiers + '}';
    }
}